//权限管理路由
//1.导入express包
const express = require('express')
    //2.创建路由对象
const routerPower = express.Router()

//3.导入权限路由处理函数模块
const handle = require('../router_handler/authorization')
    //4.权限列表获取
routerPower.get('/rights/:type', handle.getPower)
    //角色列表获取
routerPower.get('/roles', handle.rolesList)
    //添加角色
routerPower.post('/roles', handle.addRoles)
    //根据 ID 查询角色
routerPower.get('/roles/:id', handle.searchRoles)
    //编辑提交角色
routerPower.put('/roles/:id', handle.updateRoles)
    //删除角色
routerPower.delete('/roles/:id', handle.deleteRoles)
    //角色授权
routerPower.post('/roles/:roleId/rights', handle.updateRids)
    //删除角色指定权限
routerPower.delete('/roles/:roleId/rights/:rightId', handle.deleteRids)


//5.抛出路由接口
module.exports = routerPower